import pyautogui
import time
pyautogui.PAUSE = 1
# 记录鼠标的点击位置
# 记录键盘按下的位置
# 设置一些固定的等待时间
# 开始之前，有五秒钟的等待操作时间
# 加入循环操作

# a = pyautogui.locateOnScreen(r'C:\Users\wangm\Desktop\cc.png')
# print(a) # 打印结果为Box(left=0, top=0, width=300, height=400)
# if a == None:
#     print("未找到App图片!")
# else:
#     x, y = pyautogui.center(a) # 获得文件图片在现在的屏幕上面的中心坐标
#     print (x,y)


# # x, y = pyautogui.locateCenterOnScreen(r'C:\Users\wangm\Desktop\cc.png')
# print (x,y)

# pyautogui.doubleClick(x, y, button="left")

# time.sleep(5)

# a = pyautogui.locateOnScreen(r'C:\Users\wangm\Desktop\川山app.png')
# if a == None:
#     num = 0
#     while x == None:
#         if num >= 3:
#             print("超时")
#             break
#     num += 1
#     time.sleep(2)
# else:
#     x, y = pyautogui.center(a)

# pyautogui.doubleClick(x, y, button="left")

# b = pyautogui.alert(text='要开始程序么？', title='请求框', button='OK')
# print(b) # 输出结果为OK